#!usr/bin/env node

const Koa = require('koa'),
      Router = require('koa-router');

const app = new Koa(),
      router = new Router(),
      log = console.log;

router.prefix('/authors');

router.get('/',async (ctx,next)=>{
  log("得到漫画书作者列表");
  ctx.body = "查询成功"
})

router.get('/:authorName',async (ctx,next)=>{
  log("按作者姓名查询");
  ctx.body = "查询成功";
})

router.post('/',async (ctx,next)=>{
  log("添加新的漫画书作者");
  ctx.body = "添加成功";
})

router.put('/:id',async (ctx,next)=>{
  log("修改某ID的漫画书作者名称");
  ctx.body = "修改成功";
})

router.delete('/:id',(ctx,next)=>{
  log("删除某ID的漫画书作者");
  ctx.body="删除成功";
})

app.use(router.routes());
app.listen(8080); 
    
